#include <unistd.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>

void my_function(int sign_no) {
	if(sign_no == SIGINT) {
		printf("I have get SIGINT\n");
	} else if(sign_no == SIGQUIT) {
		printf("I have get SIGQUIT\n");
	}
}

int main() {
	printf("Waiting for signal SIGINT or SIGQUIT\n");
	signal(SIGINT, my_function);
	signal(SIGQUIT, my_function);
	pause();

	exit(0);
}
